public class Test {
    public static void main(String[] args) {
        int sum=0;
        int i=1;
        for( i=1;i<=100;i++) {
            if (i % 10 == 9 || i / 10 == 9) {
                sum++;
                System.out.print(i+" ");
            }

        }
        System.out.println(sum);
    }
}
